import java.awt.*;
import java.awt.event.*;
 
public class AWTDemo2 {
    public static void main(String[] args) {
        Frame frame = new Frame("AWTDemo");
        frame.addWindowListener(new AdapterDemo());
        frame.setLayout(new FlowLayout());
         
        Button button = new Button("AWT1");
        Checkbox checkbox = new Checkbox("AWT2");
        Choice choice = new Choice();
        choice.add("AWT3");
        Label label = new Label("AWT4");
        List list = new List();
        list.add("AWT5");
        TextArea textarea = new TextArea("AWT6");
        TextField textfield = new TextField("AWT7");
         
        frame.add(button);
        frame.add(checkbox);
        frame.add(choice);
        frame.add(label);
        frame.add(list);
        frame.add(textarea);
        frame.add(textfield);
         
        frame.pack();
        frame.setVisible(true);
    }
}
 
class AdapterDemo extends WindowAdapter {
    public void windowClosing(WindowEvent e) {
        System.exit(0);
    }
}